<view class="ptitle">
    <form bindsubmit="formSubmit">
        <view class="weui-cells__title">基本信息</view>
        <view class="weui-cells weui-cells_after-title">
            <view class="weui-cell">
                <view class="weui-cell__bd form-title">
                    <input class="weui-input" maxlength="100" name="title" placeholder="投票标题" value="{{helper_top.title}}"></input>
                </view>
            </view>
            <view class="weui-cell">
                <view class="weui-cell__bd form-des">
                     <textarea   bindinput="desChange" class="weui-input we-textarea" maxlength="120" name="description" placeholder="补充描述(选填)" value="{{helper_top.description}}" style="height:{{thight}}rpx"></textarea>
                </view>
            </view>
        </view>
        <view class="weui-cells__title">选项设置</view>
        <view class="weui-cells weui-cells_after-title">
            <view class="weui-cell weui-cell_switch">
                <view class="weui-cell__bd">图文投票</view>
                <view class="weui-cell__ft">
                    <switch bindchange="graphicChange" checked="{{helper_switch.graphic}}" name="graphic"></switch>
                </view>
            </view>
            <block wx:for="{{helper_opts.opts}}" wx:key="key">
            
                <view class="weui-cell vote-opt" >
                    <view class="{{helper_switch.graphic?weui-cell__hk:weui-cell__hd}}">
                        <view class="weui-label">
                            <image bindtap="voteDeleteOpt" class="delete-icon" data-index="{{index}}" src="../../img/minus-circle-fill.png"></image>
                            <image bindtap="voteUploadImage" class="add-image-icon" data-index="{{index}}" mode="aspectFill" src="{{item.url?item.url:'../../img/add-image.png'}}" wx:if="{{helper_switch.graphic}}"></image>
                        </view>
                    </view>
                    <view class="weui-cell__bd margin-left-xs">
                        <input bindinput="inputChange" class="weui-input" data-index="{{index}}" maxlength="35"  placeholder="请输入第{{index+1}}项" value="{{item.value}}"></input>
                    </view>
                </view>
            </block>
            <view bindtap="voteAddOpt" class="weui-cell vote-add-opt vote-opt" wx:if="{{!helper_switch.graphic}}">
                <view class="weui-cell__hd">
                    <view class="weui-label">
                        <image class="delete-icon" src="../../img/plus-circle-fill.png"></image>
                    </view>
                  
                </view>
                <view class="weui-cell__bd">添加选项（最多100项）</view>
            </view>
        </view>
     
        <view class="weui-cells__title">高级设置</view>
        <view class="weui-cells weui-cells_after-title">
            <!-- <view class="weui-cell date-cell">
                <view class="weui-cell__hd">
                    <view class="weui-label">截止日期</view>
                </view>
                <view class="weui-cell__bd">
                    <picker bindchange="bindDateEndChange" mode="date" name="date_end" value="{{date_end}}">
                        <view class="weui-input">{{date_end}}</view>
                    </picker>
                    <picker bindchange="bindTimeEndChange" class="date-cell-time" mode="time" name="time_end" value="{{time_end}}">
                        <view class="weui-input">{{time_end}}</view>
                    </picker>
                </view>
            </view> -->
            <view class="weui-cell weui-cell_switch">
                <view class="weui-cell__bd">允许每日投票</view>
                <view class="weui-cell__ft">
                    <switch bindchange="dailyChange" checked="{{helper_switch.daily}}" name="daily"></switch>
                </view>
            </view>
            <block wx:if="{{vote_type!=='PK'}}">
                <view class="weui-cell weui-cell_switch">
                    <view class="weui-cell__bd">允许多选</view>
                    <view class="weui-cell__ft">
                        <switch bindchange="multipleChange" checked="{{helper_switch.multiple}}" name="multiple"></switch>
                    </view>
                </view>
                <block wx:if="{{helper_switch.multiple}}">
                    <view class="weui-cell">
                        <view class="weui-cell__hd">
                            <view class="weui-label">最少可选</view>
                        </view>
                        <view class="weui-cell__bd weui-cell__ft">
                            <input bindinput="bindReplaceInput" class="weui-input margin-right" name="least" type="number" value="{{helper_multiple.least}}"></input>
                        </view>
                        <view class="weui-cell__ft">
                            <view>个选项</view>
                        </view>
                    </view>
                    <view class="weui-cell">
                        <view class="weui-cell__hd">
                            <view class="weui-label">最多可选</view>
                        </view>
                        <view class="weui-cell__bd weui-cell__ft">
                            <input bindinput="bindReplaceInput" class="weui-input margin-right" name="most" type="number" value="{{helper_multiple.most}}"></input>
                        </view>
                        <view class="weui-cell__ft">
                            <view>个选项</view>
                        </view>
                    </view>
                </block>
            </block>
            <view class="weui-cell weui-cell_switch">
                <view class="weui-cell__bd">匿名投票</view>
                <view class="weui-cell__ft">
                    <switch bindchange="anonymousChange" checked="{{helper_switch.anonymous}}" name="anonymous"></switch>
                </view>
            </view>
   
            
            <checkbox-group bindchange="checkboxChange" class="checkbox-group" wx:if="{{helper_switch.profile&&!helper_switch.anonymous}}">
                <label class="weui-cell weui-check__label" wx:for="{{checkboxItems}}" wx:key="value">
                    <checkbox checked="{{item.checked}}" class="weui-check" value="{{item.value}}"></checkbox>
                    <view class="weui-cell__hd weui-check__hd_in-checkbox">
                        <icon class="weui-icon-checkbox_circle" size="23" type="circle" wx:if="{{!item.checked}}"></icon>
                        <icon class="weui-icon-checkbox_success" size="23" type="success" wx:if="{{item.checked}}"></icon>
                    </view>
                    <view class="weui-cell__bd">{{item.name}}</view>
                </label>
            </checkbox-group>
        
        </view>
                  <button class="weui-btn blue-btn" disabled="{{submiting}}" formType="submit" type="primary" >确 定</button>
    </form>
</view>
